package com.cm.structural.adapter;

/**
 * @author cm.g
 * @date 2023/9/7 20:03
 */
public class CdPlayerAdapter implements MusicPlayer{
    private CdPlayer cdPlayer;

    public CdPlayerAdapter(CdPlayer cdPlayer) {
        this.cdPlayer = cdPlayer;
    }
    @Override
    public void play(String fileName) {
        cdPlayer.playCd(fileName);
    }

    public static void main(String[] args) {
        CdPlayer cdPlayer = new CdPlayerImpl();
        MusicPlayer musicPlayer = new CdPlayerAdapter(cdPlayer);
        musicPlayer.play("CD_NAME");
    }
}
